import 'package:flutter/material.dart';
import 'package:moose_app/ui/values/values.dart';

class ATHAuthButton extends StatelessWidget {
  final String text;
  final Function press;
  final Color color, textColor;

  const ATHAuthButton({
    Key key,
    this.text,
    this.press,
    this.color = kColorPrimary,
    this.textColor = Colors.white,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: EdgeInsets.symmetric(horizontal: kSize24, vertical: kSize16),
      width: double.infinity,
      height: kSize80,
      child: ClipRRect(
        borderRadius: BorderRadius.circular(kSize16),
        child: TextButton(
          onPressed: press,
          style: ButtonStyle(
              padding: MaterialStateProperty.all(
                  EdgeInsets.symmetric(vertical: kSize20)),
              backgroundColor: MaterialStateProperty.resolveWith((states) {
                if (states.contains(MaterialState.pressed)) {
                  return color.withOpacity(.8);
                }
                return color;
              })),
          child: Text(
            text,
            style: TextStyle(
                color: textColor,
                fontWeight: FontWeight.bold,
                fontSize: kFontSize30),
          ),
        ),
      ),
    );
  }
}
